package com.example.hms.controller;

import com.example.hms.entity.Customer;
import com.example.hms.entity.ReserveRecords;
import com.example.hms.service.ReserveRecordsService;
import com.example.hms.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/reserveRecords")
public class ReserveRecordsController {
       // 使用@Resource注解自动注入ReserveRecordsService服务层的实例
        @Resource
        private ReserveRecordsService reserveRecordsService;

        /**
         * 处理查询所有预约记录的请求
         * @param roomNumber 房间号，可选参数，用于筛选特定房间的预约记录
         * @param customerName 客户姓名，可选参数，用于筛选特定客户的预约记录
         * @param identificationCard 身份证号，可选参数，用于筛选特定身份证号的预约记录
         * @return 返回查询到的预约记录列表的Result对象
         */
        @RequestMapping(value = "selectAllReserveRecords", method = RequestMethod.GET)
        public Result selectAllReserveRecords(String roomNumber, String customerName, String identificationCard) {
            // 调用服务层方法查询预约记录，并返回结果
            return reserveRecordsService.selectAllReserveRecords(roomNumber, customerName, identificationCard);
        }

}
